<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="csrf-token" content="{{ csrf_token() }}" />
    <meta name ="keywords" content="{{$metakeyword}}">
    <meta name="description" content="{{$metadesp}}">
    <title>个人中心-个人的直播秀</title>
    <link rel="stylesheet" href="css/layout.css">
    <link rel="stylesheet" href="css/lay_icon.css">
    <link rel="stylesheet" href="css/index.css">
    <script type="text/javascript" src="/js/jquery-3.1.1.js"></script>
    <script type="text/javascript" src="/js/move3.js"></script>
    <script src="/js/layer/1.9.3/layer.js"></script>
</head>
<body>
<div class="header">
    <div class="logo">
        <a href="">MINI秀 <b>bete1.0</b></a>
    </div>
    <div class="l_rt">
        @if($user['islogin'])
            <div class="login_user">
                <div class="user_info">
                    <div class="user_icon">
                        <img src="{{$user['bigpic']}}" alt="">
                    </div>
                    <div class="user_name"><a href="/profile">{{$user['username']}}</a></div>
                </div>
                <a href="" style="font-size: 14px">退出</a>
            </div>
        @else
            <a href="javascript:;" onclick="login()">登录</a>
            <a href="javascript:;" onclick="register()">注册</a>
        @endif
    </div>
</div>
<div class="content" style="clear: both; overflow: auto;">
    <div class="setbar">
        <ul>
            <li><i class="home"></i><span>首页</span></li>
            <li><i class="cate"></i><span>分类</span></li>
            <li><i class="gc"></i><span>广场</span></li>
            <li><i class="fa"></i><span>Fans</span></li>
            <li><i class="hide"></i><span>隐藏</span></li>
        </ul>
    </div>
    <div class="con" style="width: 95%; height: 900px; float: right;">
         <div class="profile_head">
              <div class="cover_bg">
              </div>
              <div class="profile_user">
                   <div class="profile_user_icon">
                       <img src="{{$user['bigpic']}}" alt="">
                   </div>
                   <div class="profile_user_info">
                        <h3>{{$user['nickname']}}</h3>
                        <p>等级：{{$user['level_common']}}</p>
                        <div class="user_intro">
                            @if($user['interest']) {{$user['interest']}} @else 这家伙很懒，什么都没写 @endif <span class="edit"></span>
                        </div>
                   </div>
              </div>
              <div class="nav_item">
                   <ul>
                       <li><a href="">个人中心</a></li>
                       <li><a href="">账号安全</a></li>
                       <li><a href="">我的关注</a></li>
                   </ul>
              </div>
              <div class="box">
                   <div class="box_title">
                        个人信息 <a href="javascript:;" onclick="showDiag('edit_profile')">编辑</a>
                   </div>
                   <div class="item_box">
                        <ul>
                            <li>姓名：@if($user['realname']) {{$user['realname']}} @else 未填写 @endif</li>
                            <li>昵称：{{$user['nickname']}}</li>
                            <li>性别: @if ($user['sex'] == 1) 男 @else 女 @endif</li>
                            <li>爱好：</li>
                            <li>生日：@if ($user['birthday']) {{$user['birthday']}} @else 未填写 @endif</li>
                            <li>QQ：@if ($user['qq']) {{$user['qq']}} @else 未填写 @endif</li>
                            <li>微信：@if ($user['weixin']) {{$user['weixin']}} @else 未填写 @endif</li>
                            <li>居住地：@if ($user['city']) {{$user['city']}} @else 未填写 @endif</li>
                        </ul>
                        <div class="item_box1">
                             <div class="uplevl_progress">
                                  <span>{{$user['level_common']}} <b>当前等级</b></span>
                                  <div class="tips">距下一级还差 {{$level['remain']}}</div>
                                  <div class="proce_bar"><p style="width: {{$level['percent']*100}}%"></p> </div>
                                  <span>{{$level['nextlevel']}} <b>下一等级</b></span>
                             </div>
                             <div class="uplevl_tips">
                                  <p class="t1">升级攻略</p>
                                  <p>1,每天登陆得5经验,连续登录有惊喜</p>
                                  <p>2,长时间直播间在线，可得大量经验</p>
                                  <p>3,给主播送礼，可得大量经验</p>
                                  <p>4,发弹幕有几率获得经验</p>
                             </div>
                        </div>
                        <div class="item_box1">
                             <div class="title">我的财富</div>
                             <ul>
                                 <li><i class="icon_20 m"></i> {{$user['m']}} <i class="icon_16 help_16" title="M币是我站的虚拟币，仅可在本站使用"></i></li>
                                 <li><i class="icon_20 score"></i> {{$user['score']}}</li>
                                 <li><i class="icon_20 jy"></i> {{$user['experience']}}</li>
                                 <li></li>
                                 <li></li>
                             </ul>
                            <div class="title">我的特权</div>
                            <ul>
                                <li onclick="roomadminShow()"><i class="icon_20 roomadmin"></i> 房管管理 </li>
                                <li><i class="icon_20 score"></i> {{$user['score']}}</li>

                            </ul>
                        </div>
                   </div>
              </div>
              <div class="box">
                  <div class="box_title">
                      安全绑定
                  </div>
                  <div class="security_item">
                      @if ($user['bind_tel'])
                          <div class="security_icon phone_active"></div>
                      @else
                          <div class="security_icon phone"></div>
                      @endif
                      <div class="security_info">
                           <h3>@if ($user['bind_tel']) <span style="color: #ff6666">已绑定手机({{$user['tel']}})</span> @else 未绑定手机 @endif</h3>
                           <p>绑定手机号可享受安全服务</p>
                      </div>
                  </div>
                  <div class="security_item">
                      @if ($user['bind_email'])
                          <div class="security_icon email_active"></div>

                      @else
                          <div class="security_icon email"></div>

                      @endif
                      <div class="security_info">
                          <h3>@if ($user['bind_email']) 已绑至{{$user['email']}} @else 未绑定邮箱 @endif</h3>
                          <p>绑定手机号可享受安全服务</p>
                      </div>
                  </div>
                  <div class="security_item">
                      @if ($user['isaudit'] == 'y')
                          <div class="security_icon auth_active"></div>
                      @else
                          <div class="security_icon auth"></div>
                      @endif
                      <div class="security_info">
                          <h3>@if($user['isaudit'] == 'y') 已实名认证 @else 未实名认证 @endif</h3>
                          <p>绑定手机号可享受安全服务</p>
                      </div>
                  </div>
              </div>
              <div class="box">
                  <div class="box_title">
                      主播相关
                  </div>
                  @if($user['zhubo_flag'])
                  <div class="box_item3">
                       <div class="box_item3_title">
                            房间信息
                       </div>
                       <ul>
                           <li>直播间号: <span class="text_f">{{$zhuboinfo['num']}}</span> <a href="/live/roomset" style="color: #fff; height: 20px; line-height: 20px; font-size: 13px; padding: 0 5px; background: #ff6666; display: inline-block;">去直播</a></li>
                           <li>直播类别: <span class="text_f1">{{$zhuboinfo['catename']['catename']}}</span></li>
                           <li>创建时间: {{date("Y-m-d H:i:s",$zhuboinfo['addtime'])}}</li>
                           <li>直播标签：<span class="tag_text">可爱</span><span class="tag_text">可爱</span></li>
                       </ul>
                  </div>
                  <div class="item_box1">
                      <div class="box_item3_title">
                          主播等级
                      </div>
                      <div class="uplevl_progress" style="margin-top: 30px;">
                          <span>{{$user['level_zhubo']}} <b>当前等级</b></span>
                          <div class="tips" style="width: 200px">距下一级还差{{$zhuboinfo['zhubo']['remain']}}礼物</div>
                          <div class="proce_bar"><p style="{{$zhuboinfo['zhubo']['percent']*100}}"></p></div>
                          <span>{{$zhuboinfo['zhubo']['nextlevel']}} <b>下一等级</b></span>
                      </div>
                      <ul class="giftdetails">
                          <li><i class="icon_20 gift_1"></i> 本月礼物数：100</li>
                          <li><i class="icon_20 gift_1"></i> 总礼物数：{{$user['gift']}}</li>
                      </ul>
                  </div>
                  <div class="item_box1">
                      <div class="box_item3_title">
                          直播历史
                      </div>
                      @if($zhuboinfo['livehistory'])
                      <ul class="livehistory">
                          <li>直播标题：<span style="color: #2e3436;">{{$zhuboinfo['livehistory'][0]['title']}}</span></li>
                          <li>直播时长：<span style="color: #2e3436;">{{$zhuboinfo['livehistory'][0]['min']}} 分钟</span></li>
                          <li style="width: 100%!important;">开播时间：<span style="color: #2e3436">{{date("Y-m-d H:i:s",$zhuboinfo['livehistory'][0]['starttime'])}}</span></li>
                          <li style="display: block; width: 100%!important;">关播时间：<span style="color: #2e3436">{{date("Y-m-d H:i:s",$zhuboinfo['livehistory'][0]['endtime'])}}</span></li>
                      </ul>
                      @else
                          <div class="nohistory">
                               <p>暂无直播记录</p>
                               <a href="/live/roomset">去开播</a>
                          </div>
                      @endif
                  </div>
                      @else
                      <div class="nozhubo">
                           <p>暂无开通直播间</p>
                           <a href="profile/applyforzhubo">去申请直播间</a>
                      </div>
                  @endif
              </div>
         </div>
    </div>
</div>
<div class="footer"></div>
<div class="windowlayout" id="edit_profile" style="display: none;">
    <div class="windowDiag" style="width:700px; height: 400px; margin-top: 300px; position: relative;">
        <div class="w_title">编辑个人资料 <a href="javascript:;" onclick="closeDiag('edit_profile')" class="w_close"></a></div>
        <div class="form_left">
             <div class="user_pic">
                 <img src="{{$user['bigpic']}}" alt="">
             </div>
             <div class="user_name_profile">
                  <span>{{$user['nickname']}} <i></i></span>
             </div>
             <div class="upload_face_edit">
                  <div class="upload_face_btn">
                      <input type="hidden" id="facebase64">
                      <input type="file" id="file">
                       上传头像
                  </div>
                  <p class="upload_face_tips">上传提示</p>
                  <p>图片大小为200*200。</p>
                  <p>请勿上传色情，反动类的视频</p>
                  <p>图片请保持2m以内</p>
             </div>
        </div>
        <div class="form_right">
            <div class="profile_edit_tit">个人信息</div>
            <div class="profile_edit_inp">
                 <ul>
                     <li><span>姓名</span> <input type="text" value="{{$user['realname']}}"></li>
                     <li><span>性别</span><div class="edit_select" onclick="sexselect()"> <div class="select_sex">@if($user['sex']==1)男 @else 女 @endif</div> <div class="arrar_row"></div>
                             <input type="hidden" id="sexinp"> <div class="edit_select_list"><p sid="1">男</p><p sid="2">女</p></div></div></li>
                     <li><span>爱好</span> <input type="text" value="{{$user['interest']}}"></li>
                     <li><span>生日</span> <input type="text" value="{{$user['birthday']}}"></li>
                     <li><span>QQ</span> <input type="text" value="{{$user['qq']}}"></li>
                     <li><span>微信</span> <input type="text" value="{{$user['weixin']}}"></li>
                 </ul>
                 <div class="profile_sign">
                      <div class="profile_sign_title">
                           个性签名
                      </div>
                      <textarea placeholder="请输入你的个性签名"></textarea>
                 </div>
            </div>
            <div class="w_form_sub" style="text-align: right;">
                <input type="submit" class="confim" onclick="doSubmit()" value="确定">
            </div>
        </div>
    </div>
</div>
<div class="windowlayout" id="room_admin" style="display: none;">
    <div class="windowDiag" style="width:700px; height: 400px; margin-top: 300px; position: relative;">
        <div class="w_title">房管管理 <a href="javascript:;" onclick="closeDiag('room_admin')" class="w_close"></a></div>
        <div class="room_admin_tips">
             <div class="room_admin_tips_tilt">
                  房管特权
             </div>
             <div class="room_admin_tips_item">
                  <p>专属房管徽标，彰显个性身份</p>
                  <p>直播间管理，有权禁止用户发言,维护直播间和谐</p>
                  <p>与主播更亲近，让主播更关注你</p>
             </div>
        </div>
        <div class="room_admin_content">
             <div class="room_admin_con_title">禁言管理</div>
             <div class="room_admin_list">
                 <div class="loading spin"></div>
                  <ul>
                      {{--<li>sssssssssss <span>取消</span></li>--}}
                  </ul>
             </div>
        </div>
            <div class="w_form_sub" style="">
                <input type="submit" class="confim" onclick="doSubmit()" value="确定">
            </div>
    </div>
</div>
<script type="text/javascript" src="/js/profile.js"></script>
<script>
    // 上传图片

    var privewimg = document.getElementsByClassName('user_pic')[0].getElementsByTagName('img')[0];
    var file = document.getElementById('file');
    file.onchange = function(){
        // 判断文件格式
        var filename = this.value;
        var fix = filename.substring(filename.lastIndexOf('.'));
        var strRegex = "(.png|.jpg|.jpeg)$";
        var re=new RegExp(strRegex);
        if (!re.test(fix)) {
            layer.msg('格式不允许上传', {icon: 2});
            return;
        }
        var oFReader = new FileReader();
        oFReader.readAsDataURL(this.files[0]);
        oFReader.onload = function (oFREvent) {
            // 上传图片
            var data = {imagedata:oFREvent.target.result};
            $.ajax({
                type:"POST",
                url:"/profile/upload-face",
                data:data,
                dataType:"json",
                success:function (res) {
                    if (res['code']==200) {
                        privewimg.src = oFREvent.target.result;
                    }else{
                        layer.msg(res['msg'], {icon: 2});
                    }
                }
            })
        };
    }
</script>
</body>
</html>